﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using ApiGateway.Auth.Dto;
using ApiGateway.Auth.Services;
using DotNetCore.CAP;
using Gmmy.ApplicationExtension;
using Gmmy.Utility;

namespace ApiGateway.Auth.Handle
{
    public class UserCacheHandle: ProxyBaseService, IUserCacheHandle, ICapSubscribe
    {
        public IAuthService _authService;
        public UserCacheHandle(IAuthService authService)
        {
            _authService = authService;
        }

        [CapSubscribe("Gmmy.Microservices.UserServices.ChangeUserInfo")]
        public async Task UpdateToken(AuthToken input)
        {
            await _authService.UpdateToken(input);
        }
    }
}
